﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCodeCreater.Module
{
    public class CreateService
    {
        public static void Create(TableInfo tableinfo, string iserviceContent, string serviceContent, string root)
        {
            iserviceContent = iserviceContent.Replace("_tabledesc_", tableinfo.value).Replace("_name_", tableinfo.name);
            Tool.SaveFile(root + $@"\Application\Interface\I{tableinfo.name}Service.cs", iserviceContent);
            serviceContent = serviceContent.Replace("_tabledesc_", tableinfo.value).Replace("_name_", tableinfo.name);
            Tool.SaveFile(root + $@"\Application\Services\{tableinfo.name}Service.cs", serviceContent);
        }
    }
}
